import request from '@/utils/request'
import axios from 'axios'

export const productBasicList = function(params){
  return request({
    url: '/product_basic/list',
    method: 'get',
    params: params,
  })
}

export const productSelectList = function(params){
  return request({
    url: '/product_basic/product',
    method: 'get',
    params: params,
  })
}
export const articleSelectList = function(params){
  return request({
    url: '/article/article',
    method: 'get',
    params: params,
  })
}

export const productImageGet= function(params){
  return request({
    url: '/product_basic/image',
    method: 'get',
    params: params,
  })
}

export const productImagePost = function(params){
  return request({
    url: '/product_basic/image',
    method: 'post',
    data: params,
  })
}

export const productBasicAdd = function(params){
  return request({
    url: '/product_basic/add',
    method: 'post',
    data: params,
  })
}

export const productBasicDel = function(params){
  return request({
    url: '/product_basic/del',
    method: 'post',
    data: params,
  })
}

export const productBasicEditGet = function(params){
  return request({
    url: '/product_basic/edit',
    method: 'get',
    params: params,
  })
}

export const productBasicEditPost = function(params){
  return request({
    url: '/product_basic/edit',
    method: 'post',
    data: params,
  })
}


export const productModelNameList = function(params){
  return request({
    url: '/product_basic/product_model_name',
    method: 'get',
    params: params,
  })
}

export const erpProducNameList = function(params){
  return request({
    url: '/erp/product_name',
    method: 'get',
    params: params,
  })
}


export const erpAsinList = function(params){
  return request({
    url: '/erp/asin',
    method: 'get',
    params: params,
  })
}

export const productBasicTag = function(params){
  return request({
    url: '/product_basic/set_tag',
    method: 'post',
    data: params,
  })
}

export const productBasicExport = function(params){
  return request({
    url: '/product_basic/export_url',
    method: 'get',
    params: params,
  })
}

export const productSpecGet = function(params){
  return request({
    url: '/product_basic/specification',
    method: 'get',
    params: params,
  })
}

export const productSpecPost = function(params){
  return request({
    url: '/product_basic/specification',
    method: 'post',
    data: params,
  })
}

export const productStatusSwitch = function(params){
  return request({
    url: '/product_basic/status_switch',
    method: 'post',
    data: params,
  })
}

export const get_product_title = function(params){
  return request({
    url: '/product_basic/get_product_title',
    method: 'get',
    params: params,
  })
}

export const get_product_sku = function(params){
  return request({
    url: '/product_basic/product_sku_list',
    method: 'get',
    params: params,
  })
}

export const getProductParameter = function(params){
  return request({
    url: '/product_basic/parameter',
    method: 'get',
    params: params,
  })
}

export const postProductParameter = function(data){
  return request({
    url: '/product_basic/parameter',
    method: 'post',
    data
  })
}

export const getProductTitle = function(params){
  return request({
    url: '/product_basic/product_title_list',
    method: 'get',
    params: params,
  })
}

export const postImport = function(params){
  return axios.post('/api/api/product_basic/import', params)
}
